package com.ruoyi.richEditor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.richEditor.mapper.RichEditorAttachmentMapper;
import com.ruoyi.richEditor.domain.RichEditorAttachment;
import com.ruoyi.richEditor.service.IRichEditorAttachmentService;

/**
 * 富文本编辑Service业务层处理
 * 
 * @author chengliang
 * @date 2021-11-01
 */
@Service
public class RichEditorAttachmentServiceImpl implements IRichEditorAttachmentService 
{
    @Autowired
    private RichEditorAttachmentMapper richEditorAttachmentMapper;

    /**
     * 查询富文本编辑
     * 
     * @param id 富文本编辑主键
     * @return 富文本编辑
     */
    @Override
    public RichEditorAttachment selectRichEditorAttachmentById(Long id)
    {
        return richEditorAttachmentMapper.selectRichEditorAttachmentById(id);
    }

    /**
     * 查询富文本编辑列表
     * 
     * @param richEditorAttachment 富文本编辑
     * @return 富文本编辑
     */
    @Override
    public List<RichEditorAttachment> selectRichEditorAttachmentList(RichEditorAttachment richEditorAttachment)
    {
        return richEditorAttachmentMapper.selectRichEditorAttachmentList(richEditorAttachment);
    }

    /**
     * 新增富文本编辑
     * 
     * @param richEditorAttachment 富文本编辑
     * @return 结果
     */
    @Override
    public int insertRichEditorAttachment(RichEditorAttachment richEditorAttachment)
    {
        richEditorAttachment.setCreateTime(DateUtils.getNowDate());
        return richEditorAttachmentMapper.insertRichEditorAttachment(richEditorAttachment);
    }

    /**
     * 修改富文本编辑
     * 
     * @param richEditorAttachment 富文本编辑
     * @return 结果
     */
    @Override
    public int updateRichEditorAttachment(RichEditorAttachment richEditorAttachment)
    {
        richEditorAttachment.setUpdateTime(DateUtils.getNowDate());
        return richEditorAttachmentMapper.updateRichEditorAttachment(richEditorAttachment);
    }

    /**
     * 批量删除富文本编辑
     * 
     * @param ids 需要删除的富文本编辑主键
     * @return 结果
     */
    @Override
    public int deleteRichEditorAttachmentByIds(Long[] ids)
    {
        return richEditorAttachmentMapper.deleteRichEditorAttachmentByIds(ids);
    }

    /**
     * 删除富文本编辑信息
     * 
     * @param id 富文本编辑主键
     * @return 结果
     */
    @Override
    public int deleteRichEditorAttachmentById(Long id)
    {
        return richEditorAttachmentMapper.deleteRichEditorAttachmentById(id);
    }
}
